<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <link type="text/css" rel="stylesheet" href="main.css">
    <title>水上水下活动通航安全审核申请书</title>
    
	<!--jquery -->
	<script type="text/javascript" src="../js/jquery/jquery-2.0.3.min.js" ></script>
	
	<script type="text/javascript" src="../js/share.js"></script>
<!-- 	<script type="text/javascript" src="11.js" ></script> -->
	
	<script type="text/javascript">
	var itemno = "";
	var applyid = "";
	var nodeno = "";
	var orgcode = "";
	var nextnodecode1 = "";
	var selectID = "userlist";
	var applyno = "";

	$(function(){
		applyno = getUrlParam("applyno");
		bindApply(applyno);
	})


	function bindApply(applyno){
		$.ajax({ 
			url: basePath() + 'business/getapplyinfo.do',
			data: {"applyno": applyno},
			dataType: "json",
	        contentType: "application/json",
			success: function(data){
		    	if(data.result == 1){
		    		var jsonApply = data.datas;
//		    		var jsonBusiness = data.datas.business;
//		    		var jsonMaterial = data.datas.material;
		    		
		    		bindApplyForm(jsonApply);
		    		
		    		//绑定业务资料
		    		bindBusinessForm(jsonApply['applyid'], jsonApply['itemno']);
//		    		
//		    		//绑定附件材料
		    		bindMaterialListForm(jsonApply['applyid']);	 

					//绑定设备及主要技术参数
					bindDevice(jsonApply['applyid']);
		    	}
	      	}
		});
	}

	function bindApplyForm(jsonApply){
		$('#proposer').html(jsonApply['proposer']);
		
		for(var d in jsonApply){//遍历json对象的每个key/value对,p为key
			if(d == 'applytime'){
				$('#' + d).html(formatDate(jsonApply[d], 'yyyy-mm-dd hh:mi'));
			}
			else if(d == 'nodename'){
				if(jsonApply[d] == '办结')
					$('#' + d).html('<span style="color:green;font-weight: bold;">' + jsonApply[d] + '</span>');
				else if(jsonApply[d].indexOf('补正') >= 0){
					$('#' + d).html('<span style="color:red;font-weight: bold;">' + jsonApply[d] + '</span>');
					$('#correction').show();
					$('#correction').attr('href', 'correction.html?applyno=' + applyno);
				}
				else if(jsonApply[d].indexOf('申报') >= 0){
					$('#' + d).html('<span style="color:red;font-weight: bold;">未提交</span>');
					$('#edit').show();
					$('#edit').attr('href', 'edit.html?applyno=' + applyno);
				}
	        	else if(jsonApply[d].indexOf('受理') >= 0)
	        		$('#' + d).html('<span style="color:blue; font-weight: bold;">待受理</span>');
				else{
					$('#' + d).html('<span style="color:blue;font-weight: bold;">已受理</span>');
				}
			}
			else{
				$('#' + d).html(jsonApply[d] == '' ? '/' : jsonApply[d]);
			}
		}
	}

	function bindBusinessForm(applyid, itemno){

		$.ajax({ 
			url: basePath() + 'business/getbusinessinfo.do',
			data: {"applyid": applyid, "itemno": itemno},
			dataType: "json",
	        contentType: "application/json",
			success: function(data){
		    	if(data.result == 1){
		    		var jsonBusiness = data.datas;

		    		for(var d in jsonBusiness){//遍历json对象的每个key/value对,p为key
		    			if(d == 'workbegintime' || d == 'workendtime'){
		    				$('#' + d).html(formatDate(jsonBusiness[d], 'yyyy-mm-dd'));
		    			}
		    			else{
		    				$('#' + d).html(jsonBusiness[d] == '' ? '/' : jsonBusiness[d]);
		    			}
		    		}
		    	}
	      	}
		});
	}

	function bindMaterialListForm(applyid){

		$.ajax({ 
			url: basePath() + 'business/getmaterialinfo.do',
			data: {"applyid": applyid},
			dataType: "json",
	        contentType: "application/json",
			success: function(data){
		    	if(data.result == 1){
		    		var jsonMaterial = data.datas;

					var k = 1;
					for(var i = 0; i < jsonMaterial.length; i++){
						var materialname = jsonMaterial[i]['materialname'];
						
						var fileid=jsonMaterial[i]['fileid']
						if('' != fileid){
							var materialnameHmtl = k + '、' + materialname + '<br />';
							$('#material').append(materialnameHmtl);
							k++;
						}
					}
		    	}
	      	}
		});
	}

	function bindDevice(applyid){
		$.ajax({ 
			url: basePath() + 'business/getworkdevice.do?applyid='+applyid,
			dataType: "json",
			success: function(data){
		    	if(data.result == 1){
		    		var jsonDevices = data.datas;
		    		if(jsonDevices.hasOwnProperty("devices")){
		    			var jsonDevice = jsonDevices.devices;
						for(var i = 0; i < jsonDevice.length; i++){
							var devicename = jsonDevice[i]['devicename'];
							var technicalparameter = jsonDevice[i]['summary'];
							$("#materialtr").before('<tr><td class="td-4"><span>'+devicename+'</span></td><td style="width: 600px;text-align:center;font-size: 14px;"><span>'+technicalparameter+'</span></td></tr>');
						}
		    		}
		    		
		    		if(jsonDevices.hasOwnProperty("ships")){
		    			var jsonShip = jsonDevices.ships;
						for(var i = 0; i < jsonShip.length; i++){
							$("#materialtr").before('<tr><td class="td-4"><span>'+jsonShip[i]['shipname']+'</span></td><td style="width: 600px;text-align:center;font-size: 14px;"><span>'+ generator(jsonShip[i])+'</span></td></tr>');
		    			}
		    		}
		    		
		    	}
	      	}
		});
	}
	function generator(jsonDevice){
		var builddate = formatDate(jsonDevice["builddate"], 'yyyy-mm-dd');
		var technicalparameter = "总吨位:"+jsonDevice['grosstonnage']+",净吨位:"+jsonDevice['nettonnage']+",总功率:"+jsonDevice['enginepower']+",客位:"+jsonDevice['ratedseat']+",总长:"+jsonDevice['overalllength']+",型宽:"+jsonDevice['mouldedbreadth']+",型深:"+jsonDevice['mouldeddepth']+",建造日期:"+builddate+",所有人:"+jsonDevice['owner']+",经营人:"+jsonDevice['operator'];
		return technicalparameter;
	}
	</script>
</head>
<body>
<div style="height: 300px;"></div>
<p align="center" style="font-size: 30px;font-family: 'Adobe 宋体 Std L';font-weight:bold;">中 华 人 民 共 和 国</p>
<p align="center"  style="font-size: 30px;font-family: 'Adobe 宋体 Std L';font-weight:bold;margin-top: 50px">水上水下活动通航安全审核</p>
<p align="center"  style="font-size: 50px;font-family:'Adobe 黑体 Std R';font-weight:bold;margin-top: 180px">申 请 书</p>
<div style="height: 700px;"></div>
<h2 align="center" style="font-size: 30px;font-family:'Adobe 黑体 Std R';font-weight:bold;margin-top: 100px">申请人须知</h2>
<table border="0"  align="center" cellspacing="0" cellpadding="0">
    <tr style="align-content: center; font-size: 20px;">
        <td style="border-color: transparent; width:709px;">
            <ul>
                <li style="list-style: none;margin-top: 50px" >一、本申请书依据《中华人民共和国水上水下活动通航安全管理规定》制作，是申请人履行正当手续的法律依据。</li>
                <li style="list-style: none" >二、申请人必须遵守《中华人民共和国水上水下活动通航安全管理规定》并按规定要求办理申请手续。</li>
                <li style="list-style: none">三、本申请书应用钢笔，按要求认真、如实、准确填写。</li>
                <li style="list-style: none">四、填写说明：
                    <ol>
                        <li>　“作业程序”是作业者使用船舶、设施、设备和技术进行施工作业的方式、方法和步骤。</li>
                        <li>　“应急的措施”是指作业者为防止发生污染和意外事故采取的措施以及一旦发生污染和意外事故时采取的应急措施。</li>
                        <li>　“相关部门”是指审批工程或施工作业项目所涉及的本主管机关以外的部门。</li>
                        <li>　“设备”应选择最主要、最关键的填写。涉及吊装的应填报主要的吊索的尺寸和破断力；涉及拖航的应填报主拖缆的直径、长度和质地。</li>
                        <li>　“附送资料”应详细填写资料的名称、文号、图号等。</li>
                        <li>　各栏如不够填写，可附页。</li>
                    </ol>
                </li>
                <li style="list-style: none">五、施工作业项目、地点、范围、施工作业船舶等发生变更，原申请人须重新办理申请手续。</li>
                <li style="list-style: none;height: 650px">六、同一工程重新办理申请，或工程被取消，或申请人的作业资格被取消时，原申请书均不退还申请人。</li>
            </ul>
        </td>
    </tr>
</table>
<div style="height: 1280px;">
<table border="1"  align="center" cellspacing="0" cellpadding="0" style="border-style: solid;border-width: 1px;border-color: black;border-collapse: collapse; " >
    <tr>
        <td class="td-4">项目名称</td>
        <td class="td-5" style="text-align: left;">
         	&nbsp;
        	<span id="itemname"></span>
       	</td>
        <td class="td-4">计划开工日期</td>
        <td class="td-4" id="workbegintime">
       	</td>
    </tr>
    <tr>
        <td class="td-4">建设单位</td>
        <td class="td-5" style="text-align: left;">
         	&nbsp;
        	<span id="buildunitname"></span>
        </td>
        <td class="td-4">预计完工日期</td>
        <td class="td-4" id="workendtime">
        </td>
    </tr>
    <tr>
        <td class="td-4">施工单位/活动主办单位</td>
        <td colspan="3" class="td-5" style="text-align: left;">
         	&nbsp;
        	<span id="workunitname"></span>
       	</td>
    </tr>
    <tr>
        <td class="td-4">地点范围</td>
        <td colspan="3" class="td-5" style="text-align: left;">
         	&nbsp;
        	<span id="workarea"></span>
       	</td>
    </tr>
    <tr>
        <td colspan="4" valign="top" align="left" style="height: 221px;font-size: 14px;width:709px;">
       		施工作业/活动程序<br />
       		&nbsp;&nbsp;
        	<span id="workstep"></span>
        </td>
    </tr>
    <tr>
        <td colspan="4" valign="top" align="left" style="height: 500px;font-size: 14px;width:709px;">
        	应急措施<br />
        	&nbsp;&nbsp;
        	<span id="emergentstep"></span>
       	</td>
    </tr>
 </table>
 </div>

<div style="height: 1280px;">
 <table border="1" align="center" cellspacing="0" cellpadding="0" style="margin-top: 50px;border-style: solid;border-width: 1px;border-color: black;border-collapse: collapse;">
    <tr>
        <td colspan="2" class="td-4" style="height: 50px">水上水下活动船舶及设备</td>
    </tr>
    <tr>
        <td class="td-4">名称</td>
        <td align="center" style="width: 600px;font-size: 14px">主要技术参数</td>
     </tr>
    <tr id="materialtr">
        <td colspan="2" valign="top" align="left" style="height: 600px;font-size: 14px;">
        	附送材料<br />
        	<span id="material"></span>
        </td>
    </tr>
</table>

 </div>
    <table border="1" align="center" cellspacing="0" cellpadding="0" style="margin-top: 50px;border-style: solid;border-width: 1px;border-color: black;border-collapse: collapse;">
        <tr>
            <td align="center" rowspan="6" style="font-size: 14px;width: 50px">申<br>请<br>人</td>
        </tr>
        <tr>
            <td class="td-4">名 称</td>
            <td colspan="3">
        		<span id="proposer"></span>
            </td>
        </tr>
        <tr>
            <td class="td-4">地 址</td>
            <td width="350px">
        		<span id="contactaddr"></span>
            </td>
            <td class="td-4">邮编</td>
            <td class="td-4">
            	<span></span>
            </td>
        </tr>
        <tr>
            <td class="td-4">开户银行</td>
            <td width="350px">
            	<span id="material"></span>
            </td>
            <td rowspan="2" align="center" style="font-size: 14px">联系人</td>
            <td rowspan="2">
            	<span id="proposer"></span>
            </td>
        </tr>
        <tr>
            <td class="td-4">开户账号</td>
            <td width="350px">
            	<span id="material"></span>
            </td>
        </tr>
        <tr>
            <td class="td-4">电 话</td>
            <td width="250px">
            	<span id="mobilephone"></span>
            </td>
            <td class="td-4">申请日期</td>
            <td class="td-4">
            	<span id="applytime"></span>
            </td>
        </tr>
        <tr>
            <td colspan="5" valign="top" align="left" style="height: 300px;font-size: 14px;">
            	施工作业示意图：<br />
            	<span></span>
           	</td>
        </tr>
        <tr>
            <td colspan="5" valign="top" align="left" style="height: 500px;font-size: 14px;">
            	备注：<br />
            	<span></span>
           	</td>
        </tr>
    </table>
</body>
</html>